<template>
    <el-drawer :title="$t('game.data.log-login.drawer.details')" size="400px" :visible.sync="drawerVisible" @close="$emit('update:visible', false)">
        <vue-simplebar>
            <div class="pt-12 pb-12 pr-3" v-if="data.id">
                <el-form label-width="120px" class="detail">
                    <el-form-item label="UID">{{ data.uid }}</el-form-item>
                    <el-form-item :label="$t('platform.setting.tree.org')">{{ data.org.name || data.plat_code }}</el-form-item>
                    <el-form-item :label="$t('game.user.account_id')">{{ data.account_id }}</el-form-item>
                    <el-form-item :label="$t('game.data.log-login.ip')">{{ data.ip }}</el-form-item>
                    <el-form-item :label="$t('game.data.log-login.country')">{{ data.country }}</el-form-item>
                    <el-form-item :label="$t('game.data.log-login.city')">{{ data.city }}</el-form-item>
                    <el-form-item :label="$t('game.data.log-login.login_time')">
                        <component-page-timestamp :timestamp="data.login_time"></component-page-timestamp>
                    </el-form-item>
                </el-form>
            </div>
        </vue-simplebar>
    </el-drawer>
</template>

<script>
export default {
    name: "ItemDetails",
    props: ['visible', 'data'],
    data() {
        return {
            drawerVisible: false,
        }
    },
    watch: {
        visible: function (n, o) {
            if (n) {
                // 显示抽屉
                this.drawerVisible = n;
            }
        }
    },
}
</script>

<style scoped>

</style>
